package cn.com.idmy.auth;

import cn.com.idmy.base.exception.UnauthorizedException;
import org.jetbrains.annotations.NotNull;


public interface Authenticator<R, T, ID> {
    @NotNull
    Principal<T, ID> getPrincipal(@NotNull R request, @NotNull ID principalId) throws UnauthorizedException;

    @NotNull
    Principal<T, ID> authenticate(@NotNull R request, @NotNull Credential<?> credential) throws UnauthorizedException;
}